const prefix = 'process.env.';
const sso_url = 'http://sso.baicaowei.cn';
const sso_context = 'sso';
const client_id = 'sso_manage';
const sso_manage_domain_url = 'http://manage.sso.baicaowei.cn';
const sso_manage_context = 'sso-manage';
const sso_manage_front_domain_url = 'http://front.manage.sso.baicaowei.cn';
const sso_manage_front_context = 'tkey-sso-client-management-frontend';

exports.constant = {
    devConstant: {
        [`${prefix}SYSTEM_TITLE_OPEN`]: 'SSO 管理系统',
        [`${prefix}SYSTEM_TITLE_CLOSE`]: '本地',
        [`${prefix}LOCAL_STORAGE_TOKEN_KEY`]: 'tkey-token',
        [`${prefix}REQUEST_HEADER_TOKEN_KEY`]: 'x-token',
        [`${prefix}API_SERVER`]: `${sso_manage_domain_url}:8001/${sso_manage_context}`,
        [`${prefix}REQUEST_SPLICING_TKEY_SSO_BASE_URL`]: `${sso_url}:8000/${sso_context}/oauth2/authorize?response_type=code&client_id=${client_id}&redirect_uri=`,
        [`${prefix}REQUEST_SPLICING_TKEY_SSO_CODE_CALLBACK`]: `${sso_manage_front_domain_url}:9092/codeCallback?redirect_uri=`,
        [`${prefix}LOGOUT_URL`]: `${sso_manage_domain_url}:8001/${sso_manage_context}/logout?redirect_uri=${sso_manage_front_domain_url}:9092/`,
    },
    testConstant: {
        [`${prefix}SYSTEM_TITLE_OPEN`]: 'SSO 管理系统',
        [`${prefix}SYSTEM_TITLE_CLOSE`]: 'TKey',
        [`${prefix}LOCAL_STORAGE_TOKEN_KEY`]: 'tkey-token',
        [`${prefix}REQUEST_HEADER_TOKEN_KEY`]: 'x-token',
        [`${prefix}API_SERVER`]: `${sso_manage_domain_url}:8001/${sso_manage_context}`,
        [`${prefix}REQUEST_SPLICING_TKEY_SSO_BASE_URL`]: `${sso_url}/${sso_context}/oauth2/authorize?response_type=code&client_id=${client_id}&redirect_uri=`,
        [`${prefix}REQUEST_SPLICING_TKEY_SSO_CODE_CALLBACK`]: `${sso_manage_front_domain_url}:9092/${sso_manage_front_context}/codeCallback?redirect_uri=`,
        [`${prefix}LOGOUT_URL`]: `${sso_manage_domain_url}:8001/${sso_manage_context}/logout?redirect_uri=${sso_manage_front_domain_url}:9092/${sso_manage_front_context}/TKeyClient`,
    },
    prodConstant: {
        [`${prefix}SYSTEM_TITLE_OPEN`]: 'TKey SSO Client 管理系统',
        [`${prefix}SYSTEM_TITLE_CLOSE`]: 'TKey',
        [`${prefix}LOCAL_STORAGE_TOKEN_KEY`]: 'tkey-token',
        [`${prefix}REQUEST_HEADER_TOKEN_KEY`]: 'x-token',
        [`${prefix}API_SERVER`]: 'http://sso.cdk8s.com/sso-client-management',
        [`${prefix}LOGOUT_URL`]: 'http://sso.cdk8s.com/sso-client-management/logout?redirect_uri=http://sso.cdk8s.com/tkey-sso-client-management-frontend/TKeyClient',
        [`${prefix}REQUEST_SPLICING_TKEY_SSO_BASE_URL`]: 'http://sso.cdk8s.com/sso/oauth/authorize?response_type=code&client_id=client_management&redirect_uri=',
        [`${prefix}REQUEST_SPLICING_TKEY_SSO_CODE_CALLBACK`]: 'http://sso.cdk8s.com/tkey-sso-client-management-frontend/codeCallback?redirect_uri=',
    },
};
